package com.ftg.learn.controller;

import com.ftg.learn.entity.User;
import com.ftg.learn.service.Iuser;
import com.ftg.learn.service.impl.UserImpl;
import com.ftg.learn.util.BaseResultSet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 用户管理
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/3/24 上午8:32
 */
public class UserServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        Iuser iuser = new UserImpl();

//        List<User> list = iuser.showall();
        List<User> list = null;
        BaseResultSet brs = new BaseResultSet();

        brs.setCode(200);
        brs.setData(list);
        brs.setMess("成功");

        req.setAttribute("userlist", brs);


        req.getRequestDispatcher("/user/userlist.jsp").forward(req, resp);
    }
}
